package com.moli.iov.base.enums;

/**
 * @author whl
 */
public enum AlarmTypeEnum {
  ALL(0, "全部"),
  EQUIPMENT_REPLACEMENT(1, "设备更换"),
  EQUIPMENT_REMOVAL(2, "设备拆除"),
  EQUIPMENT_UNAUTHORIZED(3, "未授权车辆注册");

  private int code;
  private String name;

  private AlarmTypeEnum(int code, String name) {
    this.code = code;
    this.name = name;
  }

  public int getCode() {
    return code;
  }

  public void setCode(int code) {
    this.code = code;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public static String getCodeName(int code) {
    for (AlarmTypeEnum e : AlarmTypeEnum.values()) {
      if (e.code == code) {
        return e.name;
      }
    }
    return null;
  }
}
